import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('DataBurialPoint')
export class DataBurialPoint extends Component {
    //---------------埋点记录----------------
    //是否广告复活
    static isAdRelive: boolean = false
    // 每个广告频次记录
    static prop_a_video_frequency: number = 0; // A广告观看次数
    static prop_b_video_frequency: number = 0; // B广告观看次数
    static prop_c_video_frequency: number = 0; // C广告观看次数
    static prop_d_video_frequency: number = 0; // D广告观看次数
    static prop_e_video_frequency: number = 0; // E广告观看次数

    // 视频广告章节次数记录
    static chapter_video_num: number = 0; // 每章节广告视频观看数量// 复活总次数

    // 复活总次数
    static total_number_resurrections: number = 0; // 记录玩家通过广告复活的总次数

    // 视频解锁槽位次数
    static video_number_lots: number = 0; // 记录玩家解锁槽位的总次数

    // 卡住点的总数
    static num_of_stuck_points: number = 0; // 记录玩家卡住的点数（如陷入死局次数）

    // 首次使用时间
    static first_use_time: number = 0; // 记录玩家首次使用应用的时间

    //关卡进度
    static chapter_rate: number = 0;

    //关卡进度总数
    static card_MaxNumber: number = 0;

    //关卡进度总数
    static time: number = 0;

     // 静态方法：计算并返回观看总次数
     static calculateTotalVideoViews(): number {
        const totalViews = this.prop_a_video_frequency
                        + this.prop_b_video_frequency
                        + this.prop_c_video_frequency
                        + this.prop_d_video_frequency
                        + this.prop_e_video_frequency
                        + this.total_number_resurrections
                        + this.video_number_lots;
        return totalViews;
    }
    // 静态方法：重置所有数据
    static resetAllData(): void {
        this.isAdRelive = false;
        this.prop_a_video_frequency = 0;
        this.prop_b_video_frequency = 0;
        this.prop_c_video_frequency = 0;
        this.prop_d_video_frequency = 0;
        this.prop_e_video_frequency = 0;
        this.chapter_video_num = 0;
        this.total_number_resurrections = 0;
        this.video_number_lots = 0;
        this.num_of_stuck_points = 0;
        this.first_use_time = 0;
        this.chapter_rate = 0;
    }
}


